/*
 * File:    HandlerInterface.java
 * Created: 26-Jun-2007
 * Version: $Id$
 *
 * COPYRIGHT (C) 2007, Bitgate Software, LLC.  All Rights Reserved.
 *
 * software@bitgatesoftware.com
 */

package com.bitgate.util.service.protocol.http.handler;

import com.bitgate.util.service.protocol.http.HttpClientContext;
import com.bitgate.util.service.protocol.http.handler.HandlerException;

/**
 * This is the handler interface that handles the requests that are made from the HTTP-based client.  Since
 * GET, POST, HEAD, and other requests are made via this interface, it is very easy to separate the use of both
 * class requests into their own "partial" elements.  Therefore, this interface gives us that luxury.
 * 
 * @author kenji
 */
public interface HandlerInterface
{
	/**
	 * Handles a READ-based request.
	 * 
	 * @param hcContext The <code>HttpClientContext</code> object making the request.
	 * @return <code>true</code> if more data is to be read, <code>false</code> otherwise.
	 * @throws HandlerException on any errors.
	 */
	boolean handleRead(HttpClientContext hcContext) throws HandlerException;
	
	/**
	 * Handles a WRITE-based request.
	 * 
	 * @param hcContext The <code>HttpClientContext</code> object making the request.
	 * @return <code>true</code> if more data is to be written, <code>false</code> otherwise.
	 * @throws HandlerException on any errors.
	 */
	boolean handleWrite(HttpClientContext hcContext) throws HandlerException;
}